<?php


namespace app\index\controller;


use app\index\controller\Base;
use app\index\model\CommentList as CommentlistModel;
class Commentlist extends Base
{
    public function get(){
        $res = new CommentlistModel();
        $data=$this->request->param();
        $d =$res->with('getUser,sendUser,commentsXh')
            ->where($data['field'],$data['op'],$data['value'])
            ->page($data['page'])
            ->order('cTime desc')
            ->select();
        return $d;
    }
    public function update()
    {
        $data = $this->request->param();
        $res = new CommentlistModel();
        return $res->updateModel($data);
    }
    public function delete(){
        $data = $this->request->param();
        $res = new CommentlistModel();
        return $res->deleteModel($data);
    }
    public function save(){
        $res = new CommentlistModel();
        $data = $this->request->param();
        $res->saveModel($data);
    }
}